#include "CState.h"
using namespace Logic;
using namespace Content;
CState::CState()
{
}
CState::~CState()
{
  cleanPhysics();
}


void CState::init()
{

}


void CState::updateAllObjects(float alpha, float dT)
{
  for (unsigned int i = 0; i < objects.size(); ++i)
  {
    objects[i]->updateObject(alpha,dT);
  }

}


void CState::addGameObject(CGameObject* pObj)
{
  objects.push_back(pObj);
}

void CState::removeGameObject(CGameObject* pObj)
{
  std::vector<CGameObject*>::iterator it = 
    std::find(objects.begin(),objects.end(),pObj);
  objects.erase(it);
}

/*void CState::handleInput(float dT)
{
    if (pInput->isKeyDown(0xC8))//felf
    {
      pHitBox->moveVec(0.0,0.0,1.0f*dT);
      pCamera->moveVec(0.0f,0.0f,1.0f*dT);
    }
    if (pInput->isKeyDown(0xD0)) //le
    {
      pHitBox->moveVec(0.0,0.0,-1.0f*dT);
      pCamera->moveVec(0.0f,0.0f,-1.0f*dT);
    }

    if (pInput->isKeyDown(0xCB)) //bal
    {
      pHitBox->moveVec(-1.0f*dT,0.0,0.0f);
      pCamera->moveVec(-1.0f*dT,0.0f,0.0f);
    }
    if (pInput->isKeyDown(0xCD))//jobb
    { 
      pHitBox->moveVec(1.0f*dT,0.0,0.0f);
      pCamera->moveVec(1.0f*dT,0.0f,0.0f);
    }
	
}*/